Google Analytics
Google Analytics is the enterprise-class web analytics solution that gives our clients insights into their website traffic and marketing effectiveness. Powerful, flexible and easy-to-use features now let you see and analyze their traffic data in an entirely new way. With Google Analytics, clients will be more prepared to write better-targeted ads, strengthen their marketing initiatives and create higher converting websites.
Page Tracking
To enable simple page tracking, set the EnableWebAnalyticsPageTracking system option to checked; you must also configure the other three system options described in Ecommerce Tracking. Doing so will add a simple script to the bottom of every eWeb web page like this, only with your own Google Account name:
<script type="text/javascript">
//<![CDATA[
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-99999999-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();//]]>
</script>
To personalize the page tracker further, subclass the Avectra.netForum.Integration.netForumGoogleAnalytics.GoogleAnalytics class and override the SetAdditionalPageTrackerVariables virtual method to set call additional functions like _setDomainName.
If this is not sufficient, then override the GeneratePageTrackerScript method which returns the complete pagetracker script.
Ecommerce Tracking
NetForum eWeb can be configured to automatically add a script to the receipt page that will send information about the order to Google Analytics. For more information, see Google Analytics Ecommerce Tracking.
To do so, the following three system options must be configured:
- GoogleAnalyticsAccountName - enter the Google Analytics Account Name.
- WebAnalyticsAssembly - Enter "netForumGoogleAnalytics"
- WebAnalyticsNamespace - Enter "Avectra.netForum.Integration.netForumGoogleAnalytics.GoogleAnalytics"
- WebAnalyticsSetBaseDomainName - When set to true/checked, the Web Analytics page tracker will set the domain property (_setDomainName) to be that of the domain of the website page.
Additionally, ensure on the Shopping Cart Wizard CMS Web Page contains a page detail with the following settings. This control is included in the standard baseline eWeb web site.
- Content type: Control (ASCX)
- Form: Centralized Order Entry
- Control/file: ~/controls/ReceiptAnalytics.ascx
- row: 2
- visibility sql:
SELECT 1 WHERE {invoice} IS NOT NULL AND {invoice} !='';
Ensure this page detail precedes the page detail with the controls/receiptxslgenerator.ascx control as can be seen in the CMS Web Page.
Advanced Settings
By default, the Google Analytics script will set the "affiliation or store name" property sent in the header to be the Business Unit name for the order.
This can be overridden in the following ways:
Wizard Title
To pass the wizard title, then enter the following in the content area of the page detail
{BeginListAttributes}attributeType:WizardKey{WizardKey}{EndListAttributes}
Web Site Code
To pass the web site code, then enter the following in the content area of the page detail
{BeginListAttributes}attributeType:{Site}{EndListAttributes}
Custom
To set a different value for the affiliation or store name, then enter the following in the content area of the page detail. You may use parsed values, as long as the control(s) can be parsed by the OrderEntry object. Put what you want to pass in the XXXX placeholder.
{BeginListAttributes}attributeType:XXXX{EndListAttributes}
To further tailor how the script is generated, see Avectra.netForum.Integration.netForumGoogleAnalytics.GoogleAnalytics for override options. You must generate a custom .NET class based on this class. If you create your own subclass of this class, you must enter its assembly and namespace in the two system options listed previously, and make sure you deploy the DLL to the /eweb/bin/ directory.
Example Script
Here's an example of the script that will be added to the receipt page.
<script type="text/javascript">
//<![CDATA[
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-99999999-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-35336659-1']);
_gaq.push(['_trackPageview']);
_gaq.push(['_addTrans',
'73735',
'Avectra',
'238.90',
'12.90',
'3.00',
'Arlington',
'VA',
'UNITED STATES']);
_gaq.push(
['_addItem',
'73735',
'grayBatchCoat',
'gray Batch Coat',
'Merchandise',
'135.30',
'1.00']
);
_gaq.push(
['_addItem',
'73735',
'AV2011Fund',
'AV_2011_Fund',
'Fundraising',
'100.00',
'1.00']
);
_gaq.push(['_trackTrans']);
(function() {
var ga = document.createElement('script');
ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
//]]>
</script>